package com.haixinga.mvntemplate.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.haixinga.mvntemplate.entity.SysUser;
import com.haixinga.mvntemplate.mapper.SysUserMapper;
import com.haixinga.mvntemplate.service.ISysUserService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * <p>
 * 用户信息表 服务实现类
 * </p>
 *
 * @author mybatis-plus generator
 * @since 2019-11-07
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {


    @Override
    public List<SysUser> list(SysUser sysUser) {

        LambdaUpdateWrapper<SysUser> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
        if(!StringUtils.isEmpty(sysUser.getUserName())){
            lambdaUpdateWrapper.like(SysUser::getUserName, sysUser.getUserName());
        }
        return baseMapper.selectList(lambdaUpdateWrapper);
    }
}
